<%@page import="cn.jussi.model.User"%>
<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Insert title here</title>
</head>
<body>
	<%
		User user = new User();
		user.setUsername("admin");
		
		User user2 = new User();
		user2.setUsername("jussi");
		
		session.setAttribute("user1", user);
		session.setAttribute("user2", user2);
		
		pageContext.setAttribute("var", "user2");
	%>
	
	<!-- EL标签取出session里的username -->
	
	${sessionScope.user.username }<br>
	
	${sessionScope.user["username"] }<br>
	
	<!-- 有的时候，非[]不可 -->
	<!-- 当存取的属性名称中包含一些特殊字符，如 . 或 - 等 -->
	<!-- 当涉及变量时 -->
	${sessionScope[pageScope.var].username }<br>
	
	${sessionScope[param.user].username }<br>
	
</body>
</html>